Repository navigation
k3s follow-up: channels via INSTALL_K3S_CHANNEL, *.yml data-dir (after #8) - #9
Conversation
…-ins may be *.yml in any case The k3s installer reads INSTALL_K3S_VERSION as an exact release, so stable, latest, testing or v1.34 there would fail. The install library moves a channel name to INSTALL_K3S_CHANNEL and unsets the version before any policy check; tnctl bootstrap --k3s-version renders channels the same way. tn_ca_resolve_datadir and tn_ca_datadir_consistent read config.yaml.d/*.yaml and *.yml, suffix case-insensitive like k3s, in lexical order, last wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: c4adaf8 against 1d61656 (and bootstrap-device 6ec99e5)Verdict: changes requested (one must-fix). Must fix: an upgrade to a
|
| request (TN_K3S_UPGRADE=true) | 1d61656: installer gets | c4adaf8: installer gets |
|---|---|---|
INSTALL_K3S_VERSION=v1.33 |
VERSION=v1.33, which 404s on GitHub, so nothing is replaced |
CHANNEL=v1.33: a downgrade, and the datastore has already been migrated |
INSTALL_K3S_VERSION=v1.36 |
VERSION=v1.36, which 404s |
CHANNEL=v1.36: a two-minor jump without TN_K3S_FORCE |
At 1d61656 these requests failed safe by accident. Now they go through, and the bootstrap-device re-vendor (6ec99e5) inherits the same path, because TN_K3S_VERSION=v1.33 is exported as INSTALL_K3S_VERSION.
The channel name gives the minor version exactly; tn_inst_cgroup already reads it that way. In the upgrade branch of tn_inst_plan, when INSTALL_K3S_CHANNEL is vMAJ.MIN:
- refuse a lower minor or a different major (downgrade);
- refuse more than one minor above the installed one, unless
TN_K3S_FORCE=true.
A same-minor channel is fine, because channels only move forward.
Recommended, not blocking: also resolve stable/latest/testing before the checks, the way install.sh does (curl -w '%{url_effective}' -L ${INSTALL_K3S_CHANNEL_URL:-https://update.k3s.io/v1-release/channels}/$ch, then take the basename). That gives channels the full checks. If it cannot be resolved, keep today's warning. Strictly, INSTALL_K3S_VERSION=stable with an upgrade also used to fail safe (404). But INSTALL_K3S_CHANNEL=stable and --k3s-version stable already behaved like today at 1d61656, so I am not counting it as a regression.
Verified OK
-
Channels go to INSTALL_K3S_CHANNEL (dash, fake installer, no k3s installed):
stable,latest,testingandv1.34given asINSTALL_K3S_VERSIONreach the installer asINSTALL_K3S_CHANNEL=<value>, withINSTALL_K3S_VERSIONunset. -
Exact versions are unchanged:
v1.36.5+k3s1andv1.36.5-rc1+k3s1pass through as they did at 1d61656. A plainINSTALL_K3S_CHANNEL=latestis also unchanged. -
Keep-installed (no
TN_K3S_UPGRADE): an exact pin, a channel or the same release keeps the installedv1.34.11+k3s1, as at 1d61656. -
Exact-pin upgrades: a downgrade (
v1.33.1) is refused, a jump tov1.36.5is refused,v1.35.2is allowed, andFORCEallowsv1.36.5. All match 1d61656. -
cgroup v1, upgrade from v1.30.5:
- channel
v1.31: noINSTALL_K3S_EXECflag, which is correct because v1.31 does not need it on its first start; - channel
v1.36:--kubelet-arg=fail-cgroupv1=falseis added.
- channel
-
Agent (local fake server publishing
v1.34.11+k3s1):- a channel or
vMAJ.MINflag pin installs the server's exact release; - an exact pin newer than the server is refused, and an older one is installed;
- with the server unreachable, a channel pin is refused and an exact pin is installed with a warning;
- an agent upgrade follows the server.
All identical to 1d61656.
- a channel or
-
Data-dir drop-ins:
tn_ca_config_dropinsmatches k3s v1.36.5pkg/configfilearg.dotDFiles, which usesos.ReadDir, so the list is in byte order, matched withHasSuffixI(".yaml", ".yml"). Under dash,10-b.yml,15-e.Yml,20-c.YAML,Z-f.yamlanda-g.yamlcame out in k3s order, last one wins (/g).30-d.txtand a directory namedsub.yamlare skipped. -
go test ./...passes. The three vendored files in bootstrap-device 6ec99e5 are identical to c4adaf8.
Notes (not blocking, already true at 1d61656)
- Symlinked drop-ins: k3s reads a drop-in that is a symlink (
IsDir()is false for a symlink), butfind -type fskips it.-type f→\( -type f -o -type l \)(or-xtype f) would match k3s. - Pin source in bootstrap-device:
00_tn_header.shsetsTN_K3S_PIN_SOURCEfromINSTALL_K3S_VERSIONonly. The cli template also countsINSTALL_K3S_CHANNEL. The header comment there still saysconfig.yaml.d/*.yaml. - Conflicting values: when
INSTALL_K3S_VERSIONis a channel andINSTALL_K3S_CHANNELis also set, the version wins and overwrites the channel. That is reasonable, but it is worth a line in the docs.
🤖 Generated with Claude Code
…n INSTALL_K3S_VERSION never overwrites INSTALL_K3S_CHANNEL With TN_K3S_UPGRADE=true a vMAJ.MIN channel skipped the downgrade and multi-minor refusals. Now a minor channel is compared by major.minor (lower or other major: refused; more than +1: needs TN_K3S_FORCE), stable/latest/testing is resolved at update.k3s.io and checked as an exact release, and an unresolvable channel is refused unless TN_K3S_FORCE=true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delta review: c4adaf8..8ba02da (cli) and 6ec99e5..46cbdcd (bootstrap-device)Verdict: approve. No must-fix. This delta adds no path that proceeds where 1d61656 refused. It also never installs a release other than the one 1d61656 (or the k3s installer) would have picked. Every behaviour change is a new refusal, and a refusal happens in How it was checkedI used a separate harness under Channel cases with v1.34.11+k3s1 installed (the channel given as INSTALL_K3S_VERSION or as INSTALL_K3S_CHANNEL; results were identical either way):
The cgroup v1 with v1.30.14 installed:
Exact versions, unchanged against 1d61656: 336 server cases with 0 differences in rc, action, version, channel, effective, EXEC or deferred. The matrix crossed:
Agent path, unchanged against 1d61656: 288 cases with 0 differences. The matrix crossed:
The one new agent behaviour: TN_K3S_UPGRADE + TN_K3S_FORCE + an unreachable server + a channel now pins the release that stable resolves to, where it used to pass the channel on. Both install the same release. Other checks:
Notes (non-blocking; follow-ups worth considering)
Nothing was merged. 🤖 Generated with Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stacked on #8 (branch fix/k3s-ca-root-keycertsign, head 1d61656). Rebase and retarget to main after #8 merges; until then the diff against main includes #8.
Tests: new unit cases (channel to INSTALL_K3S_CHANNEL, exact stays exact, a fake installer asserting what it receives, dash, .yml/.YAML drop-ins); go test ./... green; harness --suite install,rerun with v1.34.11 and v1.36.5 (bs-o111) and TN_K3S_CA_LIB/TN_K3S_INSTALL_LIB set: 60 PASS, 0 mismatch.
Review fixes (8ba02da)
TN_K3S_UPGRADE=true, a channel no longer skips the downgrade and multi-minor refusals.vMAJ.MINchannel: compared by major.minor with the installed k3s; a lower minor or another major is always refused (force does not help), a jump of more than one minor needsTN_K3S_FORCE=true, same minor or +1 is allowed.stable/latest/testing: resolved like install.sh (curl -w '%{url_effective}' -L -s -S https://update.k3s.io/v1-release/channels/<ch>, last path segment), pinned as the exact release and checked in full; if it cannot be resolved the upgrade is refused unlessTN_K3S_FORCE=true(then it goes on unchecked, with a warning).INSTALL_K3S_VERSIONno longer overwrites an explicitly set, differentINSTALL_K3S_CHANNEL: refused as conflicting.go test ./...green; harness--suite install,rerun(v1.34.11, v1.36.5, bs-o111, both libs set): 30 PASS, 0 mismatch.fix/k3s-followup-vendor(46cbdcd): re-vendored, header comment on channel pins; check-vendored, check-assembly, check-setup pass.🤖 Generated with Claude Code